﻿using System;

namespace DanielVaughan.PhoneTaskModel
{
	public class TaskAdapter
	{
		readonly Action showAction;

		/// <summary>
		/// Initializes a new instance of the <see cref="TaskAdapter"/> class.
		/// </summary>
		/// <param name="showAction">The action to perform 
		/// when the Show method is called.</param>
		public TaskAdapter(Action showAction = null)
		{
			this.showAction = showAction;
		}

		public void Show()
		{
			Shown = true;
			if (showAction != null)
			{
				showAction();
			}
		}

		public bool Shown { get; set; }
	}
}
